-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate trigger form params to new UI #45270
Migrate trigger form params to new UI #45270
Conversation
51d3c4d
to
83c450e
Compare
Thanks @jscheffl for working on this. As mentioned in TODO, we will support the accordion and not flat. Some points which i noticed, just writing it down incase we don't miss.
Overall this is going in right direction. Should we have inbuilt scroll for the dynamic form? since the modal seems very long. EDIT: Just saw a todo for point 6 (json code view) and most of the above issues as todo. |
e7381e7
to
8067918
Compare
(1) I recommend to make into a separate PR - as also discussed 1:1 So... for the Layout part I'd say... ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jscheffl ! Overall it looks good. Just few comments.
When clicking on trigger run, the modal pops up with all the options at front.
Should we consider them in a accordion and if needed user can view?
Apart from it, had some general comments, which is similar for all files.
airflow/ui/src/components/FlexibleForm/FlexibleFormFieldAdvancedArray.tsx
Outdated
Show resolved
Hide resolved
airflow/ui/src/components/FlexibleForm/FlexibleFormFieldBool.tsx
Outdated
Show resolved
Hide resolved
airflow/ui/src/components/FlexibleForm/FlexibleFormFieldDate.tsx
Outdated
Show resolved
Hide resolved
8067918
to
313d868
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found one glitch, which can be taken in further work.
Also, few things to add in list of TODO:
- Reset button should reset everything on the Form, including the flexible form, and it should ask a validation pop up, since if by mistake user press it, it's lot to loose.
- Accordion should be there for flexible form fields.
- And of course connection between conf and flexible form.
airflow/ui/src/components/FlexibleForm/FlexibleFormFieldString.tsx
Outdated
Show resolved
Hide resolved
airflow/ui/src/components/FlexibleForm/FlexibleFormFieldObject.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6b61cf4
to
fcbe5d0
Compare
fcbe5d0
to
de1a47c
Compare
Had a few "sleeps" over the discussion I had in Slack with @shubhamraj-git about Accordion.. and after Pierre also assigned it to the Note for Clear tasks... I am somewhat open and ajusted... as forms can get long. All is not (last commit) in one accordion group. Looks like this and parts are nicely folding: Changing to Advanced options: WDYT? |
Hi @bbovenzi I aligned in Slack with @shubhamraj-git that he would take the "wire-up" of reset-button and sync of form fields <-> Advanced Options JSON in a follow up PR the next days. So this PR is mainly the general component start and layout, function coming in the next PR. Would it be OK frmo point of code/layout/structure mo merge? Then would need your review/approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this took me a bit to review.
Now I see how sections work with the accordions so ignore my previous comment.
It is a bit of a nitpick, but coudl we rename the field components? Along the lines of NumberInput
instead of FieldNumber
?
I'm excited we're finally able to migrate all of this to react! Great work!
de1a47c
to
1c43ce6
Compare
Uff, this was a very good review! Learned something new. I assume now it needs a second iteration review from the rework... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found two things with the datetime field.
Also, did you see my comment on renaming the Fields and NormalRow?
…o separate TSX file
1c43ce6
to
7028d76
Compare
Next round of reviews applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this all looks pretty good. Let's get this merged and continue working on the rest
* Add flexible form fields to trigger form WIP * Add flexible form fields to trigger form WIP * Fix dropdown issue * Add support for arrays of strings * Add support for advanced arrays * Remove placeholder for string * Add support for proposals in string fields * Add support for multi-select dropdowns * Add support for object fields * Add support for number fields * Add support for multiline text fields * Use other component for multi-select which displays the values * Implement support for form sections * Implement support for form sections * Add an alert that form ist not fully implemented * Review feedback - safe string handling * Review feedback, remove reloading warnings, move selector functions to separate TSX file * Review feedback - rename components for shorter name * Review feedback - adjust hard-coded color for boder in CodeMirror * Rework default field values * Move form elements into a common accorion * Review feedback * Review feedback, next round * Remove un-needed placeholders in date-time picker
After @shubhamraj-git has added the trigger form to the new React UI, this PR now adds the flexible trigger form - Based on the logic of the former AIP-50 implementation - using DAG ParamsDict to render form fields based on field definitions.
Note that the form rendering was made as a component by intent as it will be re-used in Connection Forms in future to render connection extra fields.
To test the form rendering the following DAGs might be good candidates:
example_bash_decorator
- has no params so should not display a specific formexample_bash_operator
- has one basic parameter w/o any special thing. Simple as it can beexample_params_trigger_ui
- has 4 parameters, still basic... and with advanced section un-folded:
example_params_ui_tutorial
- this is the most complex beast as it has all features as a demo that shall be supported....and the lower section un-folded:
Scope of the PR is the UI layout and logic to render. What is missing and will be a follow-up PR is the binding and sync of the form field content with the JSON dict that is used to trigger the DAG in the "Advanced Options" section.